package com.free.mini.core.serve.exception;

import com.free.mini.common.base.ResultCode;
import lombok.Data;

/**
 * @author dongsufeng
 * @version 4.0
 * @date 2023/8/19 13:17
 */
@Data
public class CoreServiceException extends RuntimeException{

    private Integer code;
    private String message;

    public CoreServiceException(){
        super();
        this.code = ResultCode.SYSTEM_ERROR.getCode();
        this.message = ResultCode.SYSTEM_ERROR.getMessage();
    }
    public CoreServiceException(ResultCode resultCode){
        super(resultCode.getMessage());
        this.code = ResultCode.SYSTEM_ERROR.getCode();
        this.message = ResultCode.SYSTEM_ERROR.getMessage();
    }

    public CoreServiceException(Integer code,String message){
        super(message);
        this.code = code;
        this.message = message;
    }
    public CoreServiceException(String message){
        super(message);
        this.code = ResultCode.SYSTEM_ERROR.getCode();
        this.message = message;
    }
}
